package com.liyuan.help_e.service.impl;

import com.liyuan.help_e.dao.NewsDao;
import com.liyuan.help_e.model.News;
import com.liyuan.help_e.model.Page;
import com.liyuan.help_e.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsServiceImpl implements NewsService {
    @Autowired
    NewsDao newsDao;

    @Override
    public News[] selectNewsByPage(Integer page, Integer size) {
        News[] news=newsDao.selectNewsByPage((page-1)*size,size);
        return news ;
    }

    @Override
    public Integer sumAllNews() {
        return newsDao.sumAllNews();
    }

    @Override
    public News[] selectNewsByReadCount(Integer hotTopicsSize) {
        return newsDao.selectNewsByReadCount(hotTopicsSize);
    }

    @Override
    public News selectNewsById(Integer id) {
        return newsDao.selectNewsById(id);
    }

    @Override
    public News[] selectNewsByScale(Integer number) {
        return newsDao.selectNewsByScale(number);
    }
}
